package cn.maxhou.t0003;

import cn.maxhou.t0001.SimpleDaoFactory;
import cn.maxhou.t0003.NewsServiceImpl;
import cn.maxhou.tongyon.dao.NewsDao;
import cn.maxhou.tongyon.pojo.News;
import org.junit.Test;

public class NewsServiceImplTest {

    @Test
    public void addNews() throws Exception {
        NewsDao dao = SimpleDaoFactory.getInstance();
        NewsServiceImpl service = new NewsServiceImpl();
        service.setDao(dao);

        News news = new News();
        news.setNtitle("测试标题2");
        news.setNcontent("测试内容2");
        service.addNews(news);
    }
}
